using System;
//using System.Collections.Generic;
//using System.Text;

namespace Animal
{
	public interface IAnimals
	{
        string AType { get; set;}
		int AEyes{ get; set;}
		int AHands{ get; set;}
		int ALegs{ get; set;}
		bool AHasHands{ get; set;}
		bool AHasTail{ get; set;}
		object AEnemy{ get; set;}		
		string AFoods{ get; set;}
	}

	public class CAnimals: IAnimals
	{
		private int iEyes, iHands, iLegs;
		private bool hasHands, hasTail;
		private object oEnemy;
		string sFood, sType;
		
		public CAnimals()
		{
			iEyes = iHands = iLegs = 0;
			hasHands = hasTail = false;
			oEnemy = null;
			sFood = sType = "";
		}

        public CAnimals(string sType, int iEyes, int iLegs, bool hasHands, int iHands, bool hasTail, object oEnemy, string sFood)
		{
            this.sType = sType;
			this.iEyes = iEyes;
			this.iLegs = iLegs;
			this.hasHands = hasHands;
			this.iHands = iHands;
			this.hasTail = hasTail;
			this.oEnemy = oEnemy;
			this.sFood = sFood;
		}

        public string AType
        {
            set { sType = value; }
            get {
                if (sType != "")
                    return sType;
                else
                    return "Unknown";
            }
        }

        public int AEyes
		{
            set { iEyes = value; }
			get { return this.iEyes;}
		}

        public int AHands
		{
            set { iHands = value; }
			get {
				if(this.hasHands)
					return iHands;
				else
					return 0;
			}
		}

        public int ALegs
		{
            set { iLegs = value; }
			get {return iLegs;}
		}

        public bool AHasHands
		{
            set { hasHands = value; }
			get {return hasHands;}
		}

        public bool AHasTail
		{
            set { hasTail = value; }
			get { return hasTail;}
		}

        public object AEnemy
		{
            set { oEnemy = value; }
			get {
                if (oEnemy == null)
                    return new CAnimals();
                else
                    return oEnemy;
            }
		}

        public string AFoods
		{
            set { sFood = value; }
			get { return sFood;}
		}
	}

	public class Animal
	{
		static void Main()
		{
            CAnimals Mouse = new CAnimals();
            CAnimals Cat = new CAnimals();
            CAnimals Dog = new CAnimals("Dog", 2, 4, false, 0, true, null, "Bones ");

            Mouse.AType = "Mouse";
            Mouse.AEnemy = Cat;
            Mouse.AEyes = 2;
            Mouse.AFoods = "Rice";
            Mouse.AHands = 0;
            Mouse.AHasHands = false;
            Mouse.AHasTail = true;
            Mouse.ALegs = 4;

            Cat.AType = "Cat";
            Cat.AEnemy = Dog;
            Cat.AEyes = 2;
            Cat.AFoods = "Fish, Mouse";
            Cat.AHands = 0;
            Cat.AHasHands = false;
            Cat.AHasTail = true;
            Cat.ALegs = 4;

			Console.WriteLine("Mouse's enemy is " + ((CAnimals)Mouse.AEnemy).AType);
            Console.WriteLine("Cat's enemy is " + ((CAnimals)Cat.AEnemy).AType);
            Console.WriteLine("Dog's enemy is " + ((CAnimals)Dog.AEnemy).AType);
            Console.ReadLine();
		}
	}
}
